<!DOCTYPE html>
<html lang="en" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<link rel="stylesheet" th:href="@{/assets/fileinput/css/fileinput.min.css}"/>
<link rel="stylesheet" th:href="@{/assets/fileinput/themes/explorer/theme.min.css}"/>
<link rel="stylesheet" th:href="@{/assets/datetime/bootstrap-datetimepicker.min.css}"/>
<link rel="stylesheet" th:href="@{/assets/css/colorbox.css}"/>
<head th:include="fragments/head::header"/>
<body>
<div th:include="fragments/top::top"></div>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <div th:include="fragments/left::left" class="sidebar" id="sidebar"></div>
        <div class="main-content">
            <!--<div class="breadcrumbs" id="breadcrumbs">-->
            <!--<ul class="breadcrumb">-->
            <!--<li>首页></li>-->
            <!--<li>院校申请</li>-->
            <!--<li id="name2">COE申请信息</li>-->
            <!--&lt;!&ndash;<li class="active">内容列表</li>&ndash;&gt;-->
            <!--</ul>-->
            <!--</div>-->

            <div class="page-content">
                <div th:include="fragments/student_info::student_info"
                     th:style="${session.studentInfoKey == null}? 'display:none'"></div>
                <h3 class="header smaller lighter blue" id="name1">COE信息</h3>
                <div id="ulId" class=""></div>
                <br/>
                <input type="hidden" name="nationId" id="nationId" th:value="${CoeApply.nationId}"/>

                <div class="tab-pane fade in active">
                    <div class="container">
                        <div class="form-horizontal">
                            <form method="post" id="edit">
                                <input type="hidden" name="" id="updateTime"
                                       th:value="${CoeApply.coeApplyInfo!=null and CoeApply.coeApplyInfo.updateTime != null}? ${#dates.format(CoeApply.coeApplyInfo.updateTime, 'yyyy-MM-dd HH:mm:ss')}"/>
                                <input type="hidden" name="applyId" id="applyId"
                                       th:value="${#httpServletRequest.getParameter('applyId')}"/>
                                <input type="hidden" name="studentNo" id="studentNo" th:value="${studentNo}"/>
                                <input type="hidden" id="input_fileName" name="coeApplyInfo.attachment"
                                       th:value="${CoeApply.coeApplyInfo.attachment}"/>
                                <input type="hidden" id="input_fileName_apply" name="coeApplyInfo.applyAttachment"
                                       th:value="${CoeApply.coeApplyInfo.applyAttachment}"/>
                                <input type="hidden" id="input_fileName_pre" name="coeApplyInfo.preAttachment"
                                       th:value="${CoeApply.coeApplyInfo.preAttachment}"/>
                                <input type="hidden" id="input_fileName_language" name="coeApplyInfo.languageAttachment"
                                       th:value="${CoeApply.coeApplyInfo.languageAttachment}"/>
                                <input type="hidden" id="resDomain" th:value="${resDomain}"/>
                                <input type="hidden" id="list_files" th:value="${list_files}"/>
                                <div class="form-group" style="height:29px">
                                    <label class="col-sm-1 control-label no-padding-right blue">课程专业</label>
                                </div>
                                <div class="form-group" style="height:29px">
                                    <input type="hidden" name="coeApplyInfo.id" id="coeApplyId"
                                           th:value="${#httpServletRequest.getParameter('id')}"/>
                                    <!--th:value="${CoeApply.coeApplyInfo!=null}? ${CoeApply.coeApplyInfo.id}"/>-->

                                    <input id="id" style="display: none;" name="applyInfo.id" class="col-sm-2"
                                           type="text"
                                           th:value="${CoeApply.applyInfo!=null}? ${CoeApply.applyInfo.id}"/>
                                    <label class="col-sm-3 control-label no-padding-right blue" for="courseName">
                                        学位名称：</label>
                                    <input class="col-sm-3" id="courseName" name=""
                                           readonly="readonly" style="width: 190px"
                                           th:value="${CoeApply.applyInfo!=null}? ${CoeApply.applyInfo.courseName}"/>
                                    <label class="col-sm-2 control-label no-padding-right blue" for="majorName">
                                        专业名称：</label>
                                    <input class="col-sm-3" id="majorName" name=""
                                           readonly="readonly" style="width: 190px"
                                           th:value="${CoeApply.applyInfo!=null}? ${CoeApply.applyInfo.majorName}"/>
                                </div>
                                <div class="form-group" style="height:29px">
                                    <label class="col-sm-3 control-label no-padding-right blue" for="">
                                        开课日期：</label>
                                    <input class="col-sm-3" id="courseStartTime" name=""
                                           readonly="readonly" style="width: 190px"
                                           th:value="${CoeApply.applyInfo.courseStartTime!=null}?  ${#dates.format(CoeApply.applyInfo.courseStartTime, 'yyyy-MM-dd HH:mm:ss')}"/>
                                    <label class="col-sm-2 control-label no-padding-right blue" for="majorDetail">
                                        专业细节：</label>
                                    <input class="col-sm-3" id="majorDetail" name=""
                                           readonly="readonly" style="width: 190px"
                                           th:value="${CoeApply.applyInfo!=null}? ${CoeApply.applyInfo.majorDetail}"/>
                                </div>


                                <div class="form-group" style="height:29px">
                                    <label class="col-sm-1 control-label no-padding-right blue">Offer信息</label>
                                </div>
                                <!-- 星爷修改位置-->
                                <div class="form-group" style="height:29px">
                                    <label class="col-sm-3 control-label no-padding-right blue">
                                        学校学号：</label>
                                    <input name="applyInfo.schoolNo" style="width:190px; height:25px" class="col-sm-2"
                                           type="text"
                                           onkeyup="value=value.replace(/[^\w\.\/]/ig,'')"
                                           th:value="${CoeApply.applyInfo != null}? ${CoeApply.applyInfo.schoolNo}"/>
                                    <label id="coeApplyDate" class="col-sm-2 control-label no-padding-right blue"
                                           for="">
                                        提交申请日期：</label>
                                    <input name="coeApplyInfo.applyDate" id="applyDate" class="Wdate col-sm-3"
                                           style="width: 190px; height:25px"
                                           onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                           th:value="${CoeApply.coeApplyInfo.applyDate!=null}?  ${#dates.format(CoeApply.coeApplyInfo.applyDate, 'yyyy-MM-dd HH:mm:ss')}"/>
                                </div>

                                <div class="form-group" style="height:29px">
                                    <label class="col-sm-3 control-label no-padding-right blue">
                                        押金金额：</label>
                                    <input name="applyInfo.depositAmount" style="width:125px; height:25px"
                                           class="col-sm-2 capital" type="number" min="0"
                                           th:value="${CoeApply.applyInfo != null}? ${CoeApply.applyInfo.depositAmount}"/>
                                    <select class="col-sm-2 form-control input-sm" id="depositAmountUnit"
                                            name="applyInfo.depositAmountUnit"
                                            style="width:65px;height:25px;">
                                        <option type="text" th:each="currencyinfo :${cList}"
                                                th:value="${currencyinfo.id}"
                                                th:text="${currencyinfo.enName}"></option>
                                    </select>

                                    <label id="resultDate" class="col-sm-2 control-label no-padding-right blue"
                                           for="">
                                        COE到达日期：</label>
                                    <input name="coeApplyInfo.coeDate" id="coeDate1" class="Wdate col-sm-3"
                                           style="width: 190px; height:25px"
                                           onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                           th:value="${CoeApply.coeApplyInfo.coeDate!=null}?  ${#dates.format(CoeApply.coeApplyInfo.coeDate, 'yyyy-MM-dd HH:mm:ss')}"/>
                                </div>

                                <div class="form-group" style="height:29px">
                                    <label class="col-sm-3 control-label no-padding-right blue">
                                        学费金额：</label>
                                    <input name="applyInfo.tuition" style="width:125px; height:25px"
                                           class="col-sm-2 capital" type="number" min="0"
                                           th:value="${CoeApply.applyInfo != null}? ${CoeApply.applyInfo.tuition}"/>
                                    <select class="col-sm-2 form-control input-sm" id="tuitionUnit"
                                            name="applyInfo.tuitionUnit"
                                            style="width:65px;height:25px;">
                                        <option type="text" th:each="currencyinfo :${cList}"
                                                th:value="${currencyinfo.id}"
                                                th:text="${currencyinfo.enName}"></option>
                                    </select>

                                    <label class="col-sm-2 control-label no-padding-right blue"
                                           for=""> 押金支付截止日期：</label>
                                    <input name="applyInfo.depositPaymentDeadline" id="coeDate" class="Wdate col-sm-3"
                                           style="width: 190px; height:25px"
                                           onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                           th:value="${CoeApply.applyInfo.depositPaymentDeadline!=null}?  ${#dates.format(CoeApply.applyInfo.depositPaymentDeadline, 'yyyy-MM-dd HH:mm:ss')}"/>
                                </div>

                                <div class="form-group" style="height:29px">
                                    <label class="col-sm-3 control-label no-padding-right blue">
                                        奖学金金额：</label>
                                    <input name="applyInfo.scholarshipAmount" style="width:125px; height:25px"
                                           class="col-sm-2 capital" type="number" min="0"
                                           th:value="${CoeApply.applyInfo != null}? ${CoeApply.applyInfo.scholarshipAmount}"/>
                                    <select class="col-sm-2 form-control input-sm" id="scholarshipAmountUnit"
                                            name="applyInfo.scholarshipAmountUnit"
                                            style="width:65px;height:25px;">
                                        <option type="text" th:each="currencyinfo :${cList}"
                                                th:value="${currencyinfo.id}"
                                                th:text="${currencyinfo.enName}"></option>
                                    </select>
                                    <label class="col-sm-2 control-label no-padding-right blue" for="majorDetail">
                                        操作人：</label>
                                    <input class="col-sm-3" id="coeOperator" name=""
                                           readonly="readonly" style="width: 190px"
                                           th:value="${CoeApply.CoeApplyInfo.operatorName!=null}? ${CoeApply.CoeApplyInfo.operatorName}"/>
                                </div>

                                <!-- 星爷修改位置-->
                                <div class="supplementInfo form-group" style="height:29px; display:none">
                                    <label id="supplementText"
                                           class="col-sm-1 control-label no-padding-right blue">邮寄包裹信息</label>
                                </div>
                                <div class="supplementInfo form-group" style="display: none;height:29px;">
                                    <label id="sendDate" class="col-sm-3 control-label no-padding-right blue"
                                           for="">
                                        邮寄最终成绩单/疫苗表日期：</label>
                                    <input type="hidden" name="supplementInfo3.id"
                                           th:value="${CoeApply.supplementInfo3 !=null}? ${CoeApply.supplementInfo3.id}"/>
                                    <input name="supplementInfo3.sendDate" class="Wdate col-sm-3"
                                           style="width: 190px; height:25px"
                                           id="coeDate3" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                           th:value="${CoeApply.supplementInfo3.sendDate!=null}?  ${#dates.format(CoeApply.supplementInfo3.sendDate, 'yyyy-MM-dd HH:mm:ss')}"/>
                                    <label id="receiveDate" class="col-sm-2 control-label no-padding-right blue"
                                           for="">
                                        录取包裹收到日期：</label>
                                    <input type="hidden" name="supplementInfo4.id"
                                           th:value="${CoeApply.supplementInfo4 !=null}? ${CoeApply.supplementInfo4.id}"/>
                                    <input name="supplementInfo4.receiveDate" class="Wdate col-sm-3"
                                           id="coeDate2" style="width: 190px; height:25px"
                                           onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                           th:value="${CoeApply.supplementInfo4.receiveDate!=null}?  ${#dates.format(CoeApply.supplementInfo4.receiveDate, 'yyyy-MM-dd HH:mm:ss')}"/>
                                </div>

                                <br/>

                                <div>
                                    <div class="form-group" style="height:100px">
                                        <label class="col-sm-3 control-label no-padding-right blue"
                                               for="majorName">备注：</label>
                                        <textarea name="CoeApplyInfo.applyComment" style="height: 100px;width: 560px"
                                                  class="col-sm-3"
                                                  th:text="${CoeApply.CoeApplyInfo.applyComment!=null}? ${CoeApply.CoeApplyInfo.applyComment}"></textarea>
                                    </div>
                                </div>

                                <div class="form-group" style="height:29px">
                                    <label class="col-sm-3 control-label no-padding-right blue">
                                        确认人姓名：</label>
                                    <input name="applyInfo.schoolNo" style="width:190px; height:25px" class="col-sm-2"
                                           type="text" readonly="readonly"
                                           th:value="${CoeApply.coeApplyInfo != null}? ${CoeApply.coeApplyInfo.confirmOperatorName}"/>
                                    <label id="coeConfirmDate" class="col-sm-2 control-label no-padding-right blue"
                                           for="">
                                        确认日期：</label>
                                    <input name="coeApplyInfo.applyDate" id="coeConfirmTime" class="Wdate col-sm-3"
                                           style="width: 190px; height:25px" readonly="readonly"
                                           th:value="${CoeApply.coeApplyInfo.confirmTime!=null}?  ${#dates.format(CoeApply.coeApplyInfo.confirmTime, 'yyyy-MM-dd HH:mm:ss')}"/>
                                </div>
                            </form>

                            <form method="post" action="/upload" id="form_file_apply" enctype="multipart/form-data">
                                <label class="col-sm-3 control-label no-padding-right blue" for="courseName">
                                    申请附件上传：</label>
                                <div class="tab-pane fade in active">
                                    <div class="container">
                                        <div class="form-horizontal">
                                            <div class="form-group">
                                                <div class="col-sm-6" style="padding-left: 0px;">
                                                    <div class="widget-header">
                                                        <h4>文件上传</h4>
                                                    </div>
                                                    <div class="widget-body">
                                                        <div class="widget-main">
                                                            <span id="offer_attachment_apply"
                                                                  style="display: none"><span
                                                                    id="offerAttachment_show_apply"
                                                                    th:text="${CoeApply.coeApplyInfo.applyAttachment}"></span><span
                                                                    class="btn btn-sm btn-primary" style="left:9%"
                                                                    id="offer_show_apply">预览</span><a
                                                                    th:href="${CoeApply.coeApplyInfo.applyAttachment}"
                                                                    download="offer信息下载" id="upload_office_apply">
                                                            </a></span>
                                                            <input name="fileInput" type="file"
                                                                   id="id-input-file-3_apply"/>
                                                            <label>
                                                                <input type="checkbox" name="file-format"
                                                                       id="id-file-format_apply" class="ace"/>
                                                            </label>
                                                            <span style="color: #FF2F2F">*上传文件的格式为&nbsp;:&nbsp;&nbsp; .jpg，&nbsp;.png，&nbsp;.gif,&nbsp;.doc，&nbsp;.docx，&nbsp;.pdf</span>
                                                            <input name="privateAccess" type="hidden" value="true"/>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>


                            <!--<input id="offerAttachment" th:value ="${CoeApply.coeApplyInfo.Attachment}" style="display: none"/>-->
                            <!--<input id = "input_fileName" name="" th:value="${CoeApply.coeApplyInfo!=null}? ${CoeApply.coeApplyInfo.Attachment}" style="display: none"/>-->

                            <form method="post" action="/upload" id="form_file" enctype="multipart/form-data">
                                <label class="col-sm-3 control-label no-padding-right blue" for="courseName">
                                    申请结果附件上传：</label>
                                <div class="tab-pane fade in active">
                                    <div class="container">
                                        <div class="form-horizontal">
                                            <div class="form-group">
                                                <div class="col-sm-6" style="padding-left: 0px;">
                                                    <div class="widget-header">
                                                        <h4>文件上传</h4>
                                                    </div>
                                                    <div class="widget-body">
                                                        <div class="widget-main">
                                                            <span id="offer_attachment" style="display: none"><span
                                                                    id="offerAttachment_show"
                                                                    th:text="${CoeApply.coeApplyInfo.Attachment}"></span><span
                                                                    class="btn btn-sm btn-primary" style="left:9%"
                                                                    id="offer_show">预览</span><a
                                                                    th:href="${CoeApply.coeApplyInfo.Attachment}"
                                                                    download="offer信息下载" id="upload_office">
                                                            </a></span>
                                                            <input name="fileInput" type="file" id="id-input-file-3"/>
                                                            <label>
                                                                <input type="checkbox" name="file-format"
                                                                       id="id-file-format" class="ace"/>
                                                            </label>
                                                            <span style="color: #FF2F2F">*上传文件的格式为&nbsp;:&nbsp;&nbsp; .jpg，&nbsp;.png，&nbsp;.gif,&nbsp;.doc，&nbsp;.docx，&nbsp;.pdf</span>
                                                            <input name="privateAccess" type="hidden" value="true"/>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>

                            <form method="post" action="/uploadFiles" id="form_file_pre" enctype="multipart/form-data" >
                            <label class="col-sm-3 control-label no-padding-right blue" for="courseName">
                            多文件上传：</label>
                            <div  class="tab-pane fade in active">
                            <div class="container">
                            <div class="form-horizontal">
                            <div class="form-group">
                            <div class="col-sm-6" style="padding-left: 0px;" >
                            <div class="widget-header">
                            <h4>文件上传</h4>
                            </div>
                            <div class="widget-body">
                            <div class="widget-main">
                            <!--<span id = "offer_attachment_pre" style="display: none"><span id = "offerAttachment_show_pre" th:text="${CoeApply.coeApplyInfo.preAttachment}"></span><span class="btn btn-sm btn-primary" style="left:9%" id = "offer_show_pre">预览</span><a th:href="${CoeApply.coeApplyInfo.preAttachment}" download="offer信息下载" id="upload_office_pre"><span class="btn btn-sm btn-primary" style="left:15%" id = "offer_upload_pre">下载</span></a></span>-->
                            <input name ="fileInput"  type="file" multiple="multiple"  id="id-input-file-3_pre" />
                            <label>
                            <input type="checkbox" name="file-format" id="id-file-format_pre" class="ace" />
                            </label>
                            <span style="color: #FF2F2F">*上传文件的格式为&nbsp;:&nbsp;&nbsp; .jpg，&nbsp;.png，&nbsp;.gif,&nbsp;.doc，&nbsp;.docx，&nbsp;.pdf</span>
                            <input name="privateAccess" type="hidden" value="true"/>
                            </div>
                            </div>
                            </div>
                            </div>
                            </div>
                            </div>
                            </div>
                            </form>

                            <!--<form method="post" action="/upload" id="form_file_language" enctype="multipart/form-data" >-->
                            <!--<label class="col-sm-3 control-label no-padding-right blue" for="courseName">-->
                            <!--结果附件上传-语言：</label>-->
                            <!--<div  class="tab-pane fade in active">-->
                            <!--<div class="container">-->
                            <!--<div class="form-horizontal">-->
                            <!--<div class="form-group">-->
                            <!--<div class="col-sm-6" style="padding-left: 0px;" >-->
                            <!--<div class="widget-header">-->
                            <!--<h4>文件上传</h4>-->
                            <!--</div>-->
                            <!--<div class="widget-body">-->
                            <!--<div class="widget-main">-->
                            <!--<span id = "offer_attachment_language" style="display: none"><span id = "offerAttachment_show_language" th:text="${CoeApply.coeApplyInfo.languageAttachment}"></span><span class="btn btn-sm btn-primary" style="left:9%" id = "offer_show_language">预览</span><a th:href="${CoeApply.coeApplyInfo.languageAttachment}" download="offer信息下载" id="upload_office_language"><span class="btn btn-sm btn-primary" style="left:15%" id = "offer_upload_language">下载</span></a></span>-->
                            <!--<input name ="fileInput"  type="file" id="id-input-file-3_language" />-->
                            <!--<label>-->
                            <!--<input type="checkbox" name="file-format" id="id-file-format_language" class="ace" />-->
                            <!--</label>-->
                            <!--<span style="color: #FF2F2F">*上传文件的格式为&nbsp;:&nbsp;&nbsp; .jpg，&nbsp;.png，&nbsp;.gif,&nbsp;.doc，&nbsp;.docx，&nbsp;.pdf</span>-->
                            <!--</div>-->
                            <!--</div>-->
                            <!--</div>-->
                            <!--</div>-->
                            <!--</div>-->
                            <!--</div>-->
                            <!--</div>-->
                            <!--</form>-->
                            <div class="form-group" style="margin-top: 40px;" th:unless="${#lists.isEmpty(list_files)}">
                                <h3 class="header smaller lighter blue" id="name3">COE多文件列表</h3>
                                <table class="table" width="450" border="1" cellspacing="4"
                                       cellpadding="1">
                                    <tr>
                                        <td align="center">附件地址</td>
                                        <td align="center">操作人</td>
                                        <td align="center">添加时间</td>
                                        <td align="center">操作</td>
                                    </tr>
                                    <tr th:each="item,itemStat:${list_files}">
                                        <td style="text-align: center; vertical-align: middle;"><a th:text="${item.attachment}" id="1" onclick="showAttachment(this.text)"></a></td>
                                        <td style="text-align: center; vertical-align: middle;" th:text="${item.operatorName}"></td>
                                        <td style="text-align: center; vertical-align: middle;" th:text="${item.createdTime!=null}?${#dates.format(item.createdTime, 'yyyy-MM-dd')}"></td>
                                        <td style="text-align: center; vertical-align: middle;"><button th:value="${item.id}" th:text="删除" onclick="delete_file(this.value)"></button></td>
                                    </tr>
                                </table>
                            </div>

                            <div class="form-group" th:style="${hasAuditInfo == true}? 'height:29px': 'display:none'">
                                <label class="col-sm-3 control-label no-padding-right blue">
                                    待审批人OA：<span
                                        th:text="${waitAuditNo != null and waitAuditName != null}? ${waitAuditNo + '-' +  waitAuditName}"></span>
                                </label>
                            </div>


                            <!-- 审核信息 -->
                            <div class="form-group auditResult_content">

                            </div>
                        </div>
                    </div>
                </div>

                <div id="alert" class="alert alert-success" style="margin-top:50px" role="alert">
                    <span>审批通过后：
                        <br/>1.可以为学生准备办理签证了。
                        <br/>2.注册奖的绩效就拿到了哦。
                        <br/>(外联顾问绩效，需要具有外联经理权限的老师点击下确认按钮）</span>
                    <span id="alertText"></span>
                </div>
                <div class="modal-footer">
                    <button type="button" id="returnPage" class="btn btn-primary" data-dismiss="modal">
                        返回
                    </button>
                    <shiro:hasPermission name="APPLY:COE:SAVE">
                        <button type="button" class="btn btn-primary" id="submits">
                            保存
                        </button>
                    </shiro:hasPermission>
                    <shiro:hasRole name="审批coe信息">
                        <button type="button" class="btn btn-primary" id="approve">
                            审批
                        </button>
                    </shiro:hasRole>
                    <a class="blue" href="javascript:void(0);" onclick="tips()"><i class="icon-question-sign bigger-140"></i></a>
                </div>
            </div>
        </div>

        <div th:include="fragments/bottom::bottom"></div>
    </div>

    <a href="#" id="btn-scroll-up"
       class="btn-scroll-up btn btn-sm btn-inverse"> <i
            class="icon-double-angle-up icon-only bigger-110"></i>
    </a>
</div>

<!-- Modal备注 -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">

        </div>
    </div>
</div>

<!-- Modal备注 -->
<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <h2 style="color: green" id="result">审核通过</h2>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
            </div>
        </div>
    </div>
</div>

<div th:include="fragments/js::js"></div>

<script th:src="@{/assets/js/jquery.dataTables.min.js}"></script>
<script th:src="@{/assets/js/jquery.dataTables.bootstrap.js}"></script>
<script th:src="@{/assets/js/temp.js}" charset="UTF-8"></script>
<script th:src="@{/js/common/uploadimg.js}" charset="UTF-8"></script>
<script th:src="@{/js/common/ajaxfileupload.js}" charset="UTF-8"></script>
<!--图片查看器-->
<script th:src="@{/assets/js/jquery.form.js}"></script>
<script th:src="@{/assets/js/jquery.colorbox-min.js}"></script>
<script th:src="@{/layer/layer.js}"></script>
<script th:src="@{/My97DatePicker/WdatePicker.js}"></script>

<script th:src="@{/assets/js/chosen.jquery.min.js}"></script>
<script th:src="@{/assets/js/date-time/bootstrap-datepicker.min.js}"></script>
<script th:src="@{/assets/js/date-time/bootstrap-timepicker.min.js}"></script>

<script th:src="@{/assets/fileinput/js/fileinput.js}"></script>
<script th:src="@{/assets/fileinput/themes/explorer/theme.min.js}"></script>
<script th:src="@{/business/CoeApply/detail.js}"></script>
<script th:src="@{/business/common.js}"></script>
<script th:src="@{/js/upload/upload.js}"></script>
<script th:src="@{/assets/fileinput/js/locales/zh.js}"></script>

<script th:src="@{/js/upload/filePath.js}"></script>

<script type="text/javascript" th:inline="javascript">

    /*<![CDATA[*/
    var canApprove = [[${canApprove}]];

    var canSave = [[${canSave}]];

    var approveStatus = [[${approveStatus}]];

    var attachment = [[${CoeApply.coeApplyInfo.attachment}]];

    var studentNo = $('#studentNo').val();
    //学费金额单位
    var tuitionUnit = [[${CoeApply.applyInfo.tuitionUnit}]];
    //押金金额单位
    var depositAmountUnit = [[${CoeApply.applyInfo.depositAmountUnit}]];
    //奖学金金额单位
    var scholarshipAmountUnit = [[${CoeApply.applyInfo.scholarshipAmountUnit}]];

    var data_offer = [[${CoeApply.coeApplyInfo.attachment}]];

    var data_offer_apply = [[${CoeApply.coeApplyInfo.applyAttachment}]];

    var data_offer_pre = [[${CoeApply.coeApplyInfo.preAttachment}]];

    var data_offer_language = [[${CoeApply.coeApplyInfo.languageAttachment}]];

    var file = $("#1").val();

    $(function () {

        //货币单位回写
        $("#tuitionUnit option[value=" + tuitionUnit + "]").attr("selected", true);
        $("#depositAmountUnit option[value=" + depositAmountUnit + "]").attr("selected", true);
        $("#scholarshipAmountUnit option[value=" + scholarshipAmountUnit + "]").attr("selected", true);

        <!--inputStatus(approveStatus);-->

        if (data_offer != null && data_offer != "") {
            $("#offerAttachment_show").text(data_offer.substring(0, 50) + "...");
        }
        if (data_offer_apply != null && data_offer_apply != "") {
            $("#offerAttachment_show_apply").text(data_offer_apply.substring(0, 50) + "...");
        }
        if (data_offer_pre != null && data_offer_pre != "") {
            $("#offerAttachment_show_pre").text(data_offer_pre.substring(0, 50) + "...");
        }
        if (data_offer_language != null && data_offer_language != "") {
            $("#offerAttachment_show_language").text(data_offer_language.substring(0, 50) + "...");
        }
        $("#offer_show").click(function () {
//            if ($("#input_fileName").val().indexOf($("#resDomain").val()) == -1) {
//
//                window.open($("#resDomain").val() + URLencode($("#input_fileName").val()));
//            } else {
//                window.open(URLencode($("#input_fileName").val()));
//            }
            $.post("/getPrivateUrl",{"fileUrl":$("#input_fileName").val()},function (data,status) {
                window.open(data);
            });
        });
        $("#offer_show_apply").click(function () {
//            if ($("#input_fileName_apply").val().indexOf($("#resDomain").val()) == -1) {
//                window.open($("#resDomain").val() + URLencode($("#input_fileName_apply").val()));
//            } else {
//                window.open(URLencode($("#input_fileName_apply").val()));
//            }
            $.post("/getPrivateUrl",{"fileUrl":$("#input_fileName_apply").val()},function (data,status) {
                window.open(data);
            });
        });
//        $("#offer_show_pre").click(function () {
//            if ($("#input_fileName_pre").val().indexOf($("#resDomain").val()) == -1) {
//                window.open($("#resDomain").val() + URLencode($("#input_fileName_pre").val()));
//            } else {
//                window.open(URLencode($("#input_fileName_pre").val()));
//            }
//        });
        $("#offer_show_language").click(function () {
//            if ($("#input_fileName_language").val().indexOf($("#resDomain").val()) == -1) {
//                window.open($("#resDomain").val() + URLencode($("#input_fileName_language").val()));
//            } else {
//                window.open(URLencode($("#input_fileName_language").val()));
//            }
            $.post("/getPrivateUrl",{"fileUrl":$("#input_fileName_language").val()},function (data,status) {
                window.open(data);
            });
        });

        $("#offer_upload").click(function () {
            if ($("#input_fileName").val().indexOf($("#resDomain").val()) == -1) {
                $("#upload_office").attr("href", $("#resDomain").val() + URLencode($("#input_fileName").val()));
            } else {
                $("#upload_office").attr("href", URLencode($("#input_fileName").val()));
            }
        });
        $("#offer_upload_apply").click(function () {
            if ($("#input_fileName_apply").val().indexOf($("#resDomain").val()) == -1) {
                $("#upload_office_apply").attr("href", $("#resDomain").val() + URLencode($("#input_fileName_apply").val()));
            } else {
                $("#upload_office_apply").attr("href", URLencode($("#input_fileName_apply").val()));
            }
        });
//        $("#offer_upload_pre").click(function () {
//            if ($("#input_fileName_pre").val().indexOf($("#resDomain").val()) == -1) {
//                $("#upload_office_pre").attr("href", $("#resDomain").val() + URLencode($("#input_fileName_pre").val()));
//            } else {
//                $("#upload_office_pre").attr("href", URLencode($("#input_fileName_pre").val()));
//            }
//        });
        $("#offer_upload_language").click(function () {
            if ($("#input_fileName_language").val().indexOf($("#resDomain").val()) == -1) {
                $("#upload_office_language").attr("href", $("#resDomain").val() + URLencode($("#input_fileName_language").val()));
            } else {
                $("#upload_office_language").attr("href", URLencode($("#input_fileName_language").val()));
            }
        });

    });
    $(function () {
        if (data_offer == null || data_offer == "") {
            upLoadImg();
        } else {
            $("#upload_offer").attr("style", "height:270px");
            $("#offer_attachment").show();
            upLoadImg();
        }
    });

    $(function () {
        if (data_offer_apply == null || data_offer_apply == "") {
            upLoadImgApply();
        } else {
            $("#upload_offer_apply").attr("style", "height:270px");
            $("#offer_attachment_apply").show();
            upLoadImgApply();
        }
    });
    $(function () {
        if (data_offer_pre == null || data_offer_pre == "") {
            upLoadImgPre();
        } else {
            $("#upload_offer_pre").attr("style", "height:270px");
            $("#offer_attachment_pre").show();
            upLoadImgPre();
        }
    });
    $(function () {
        if (data_offer_language == null || data_offer_language == "") {
            upLoadImgLanguage();
        } else {
            $("#upload_offer_language").attr("style", "height:270px");
            $("#offer_attachment_language").show();
            upLoadImgLanguage();
        }
    });

    function upLoadImg() {
        $('#id-input-file-3').ace_file_input({
            style: 'well',
            btn_choose: 'Drop files here or click to choose',
            btn_change: null,
            no_icon: 'icon-cloud-upload',
            droppable: true,
            thumbnail: 'small',//large | fit
            before_change: function (files, dropped) {
                return true;
            },
            before_remove: function () {
                $("#upload_offer").attr("style", "height:270px");
                $("#offerAttachment").val(data_offer);
                $("#input_fileName").val(data_offer);
                return true;
            },
            preview_error: function (filename, error_code) {
            }
        }).on('change', function () {
            uploadResult = false;
            layer.msg('正在上传中...', {
                icon: 16
                , shade: 0.01
            });
            if (!checkUp(this)) {
                return false;
            }
            $("#form_file").ajaxSubmit(function (message) {
                console.log(message);
                uploadResult = true;
                var fileName = message.obj;
                console.log(fileName);
                var code = message.code;
                if (code == "1") {
                    layer.msg("请上传正确的文件格式!")
                } else if (message.success) {
                    $("#upload_offer").attr("style", "height:200px");
                    $("#input_fileName").val(fileName);
                    $("#offerAttachment").val(fileName);
                    layer.msg("上传成功!");
                }
            });
        });
    }

    function upLoadImgApply() {
        $('#id-input-file-3_apply').ace_file_input({
            style: 'well',
            btn_choose: 'Drop files here or click to choose',
            btn_change: null,
            no_icon: 'icon-cloud-upload',
            droppable: true,
            thumbnail: 'small',//large | fit
            before_change: function (files, dropped) {
                return true;
            },
            before_remove: function () {
                $("#upload_offer_apply").attr("style", "height:270px");
                $("#offerAttachment_apply").val(data_offer_apply);
                $("#input_fileName_apply").val(data_offer_apply);
                return true;
            },
            preview_error: function (fileNameApply, error_code) {
            }
        }).on('change', function () {
            uploadResult = false;
            layer.msg('正在上传中...', {
                icon: 16
                , shade: 0.01
            });
            if (!checkUp(this)) {
                return false;
            }
            $("#form_file_apply").ajaxSubmit(function (message) {
                console.log(message);
                uploadResult = true;
                var fileNameApply = message.obj;
                var code = message.code;
                if (code == "1") {
                    layer.msg("请上传正确的文件格式!")
                } else if (message.success) {
                    $("#upload_offer_apply").attr("style", "height:200px");
                    $("#input_fileName_apply").val(fileNameApply);
                    $("#offerAttachment_apply").val(fileNameApply);
                    layer.msg("上传成功!");
                }
            });
        });
    }

    function upLoadImgPre() {
        $('#id-input-file-3_pre').ace_file_input({
            style: 'well',
            btn_choose: 'Drop files here or click to choose',
            btn_change: null,
            no_icon: 'icon-cloud-upload',
            droppable: true,
            thumbnail: 'small',//large | fit
            before_change: function (files, dropped) {
                return true;
            },
            before_remove: function () {
                $("#upload_offer_pre").attr("style", "height:270px");
                $("#offerAttachment_pre").val(data_offer_pre);
                $("#input_fileName_pre").val(data_offer_pre);
                return true;
            },
            preview_error: function (fileNamePre, error_code) {
            }
        }).on('change', function () {
            uploadResult = false;
            layer.msg('正在上传中...', {
                icon: 16
                , shade: 0.01
            });

            if (!checkUp(this)) {
                return false;
            }

            $("#form_file_pre").ajaxSubmit(function (message) {
                console.log(message);
                uploadResult = true;
                var fileNamePre = message.objNew;
                var code = message.code;
                if (code == "1") {
                    layer.msg("请上传正确的文件格式!")
                } else if (message.success) {
                    $("#upload_offer_pre").attr("style", "height:200px");
                    $("#input_fileName_pre").val(fileNamePre);
                    $("#offerAttachment_pre").val(fileNamePre);
                    layer.msg("上传成功!");
                }
            });
        });
    }

    function upLoadImgLanguage() {
        $('#id-input-file-3_language').ace_file_input({
            style: 'well',
            btn_choose: 'Drop files here or click to choose',
            btn_change: null,
            no_icon: 'icon-cloud-upload',
            droppable: true,
            thumbnail: 'small',//large | fit
            before_change: function (files, dropped) {
                return true;
            },
            before_remove: function () {
                $("#upload_offer_language").attr("style", "height:270px");
                $("#offerAttachment_language").val(data_offer_language);
                $("#input_fileName_language").val(data_offer_language);
                return true;
            },
            preview_error: function (fileNameLanguage, error_code) {
            }
        }).on('change', function () {
            uploadResult = false;
            layer.msg('正在上传中...', {
                icon: 16
                , shade: 0.01
            });

            if (!checkUp(this)) {
                return false;
            }

            $("#form_file_language").ajaxSubmit(function (message) {
                console.log(message);
                uploadResult = true;
                var fileNameLanguage = message.obj;
                var code = message.code;
                if (code == "1") {
                    layer.msg("请上传正确的文件格式!")
                } else if (message.success) {
                    $("#upload_offer_language").attr("style", "height:200px");
                    $("#input_fileName_language").val(fileNameLanguage);
                    $("#offerAttachment_language").val(fileNameLanguage);
                    layer.msg("上传成功!");
                }
            });
        });
    }

    function showAttachment(showAttachment) {
//        if (showAttachment.indexOf($("#resDomain").val()) == -1) {
//            window.open($("#resDomain").val() + URLencode(showAttachment));
//        } else {
//            window.open(URLencode(showAttachment));
//        }
        $.post("/getPrivateUrl",{"fileUrl":showAttachment},function (data,status) {
            window.open(data);
        });

    }

    $("#alert").css("visibility","hidden");
    function tips(){
        if($("#alert").css("visibility")=="hidden"){
            $("#alert").css("visibility","visible");
        }else{
            $("#alert").css("visibility","hidden");
        }
    }


    /*]]>*/
</script>
</body>
</html>
